﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace game_for_test_helper.src
{
    class Wallet
    {
        private int id;
        private long amount;
        private int version;


        public int Version
        {
            get { return version; }
            set { version = value; }
        }
        public bool Deposit(long DepositAmount)
        {
            amount = amount + DepositAmount;
            return true;
        }
        public bool Withdraw(long WithdrawAmount)
        {
            Object obj = new Object();
            lock (obj)
            {
                if (amount >= WithdrawAmount)
                {
                    amount = amount - WithdrawAmount;
                    return true;
                }
                return false;
            }
        }
        public int GetTwo()
        {
            return 2;
        }
        public int Id
        {
            get { return id; }
            set { id = value; }
        }
        public long Amount
        {
            get { return amount; }
            set { amount = value; }
        }

    }
}
